import { Message } from 'element-ui'
export function loginMessageShow(code) {
  if (code === 0) {
    return true
  } else if (code === -1) {
    Message({
      message: '网络异常，请稍后重试',
      type: 'error',
      duration: 5 * 1000
    })
    return false
  } else if (code === 6002) {
    Message({
      message: '验证码错误',
      type: 'error',
      duration: 5 * 1000
    })
    return false
  } else if (code === 6003) {
    Message({
      message: '用户名/密码错误',
      type: 'error',
      duration: 5 * 1000
    })
    return false
  } else if (code === 401) {
    Message({
      message: '登录超时，请重新登录',
      type: 'error',
      duration: 5 * 1000
    })
    return false
  } else if (code === 422) {
    Message({
      message: '参数错误',
      type: 'error',
      duration: 5 * 1000
    })
    return false
  }
}
